package com.link2room.optimus.controller.manager;

import com.link2room.common.dto.result.base.BaseResultDto;
import com.link2room.common.dto.param.base.BaseL2rParamDto;
import com.link2room.common.jpa.result.QueryResult;
import com.link2room.optimus.facade.IPriceBaseFacadeService;
import com.link2room.optimus.dto.result.base.PriceBaseDto;
import com.link2room.sideswipe.permissionResouces.annotation.L2RPermissionResources;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

import static com.link2room.optimus.constant.PermissionConstant.priceBases;

/**
 * Created by sss on 2016/8/29.
 */
@Api(tags = "房价基础信息管理")
@RestController
@RequestMapping("/manager/PriceBases")
public class PriceBaseManagerController {
    @Resource
    private IPriceBaseFacadeService priceBaseFacadeService;

    @ApiOperation(value = "获取房价基础信息列表",response = PriceBaseDto.class)
    @RequestMapping(method = RequestMethod.GET)
    @L2RPermissionResources(value = priceBases,name = "获取房价基础信息列表")
    public BaseResultDto priceBases() throws Exception {
        BaseL2rParamDto baseL2rParamDto =new BaseL2rParamDto();
        QueryResult<PriceBaseDto> priceBaseResult = priceBaseFacadeService.listPriceBases(baseL2rParamDto);
        BaseResultDto l2rRs=new BaseResultDto();
        l2rRs.setResultCode(0);
        l2rRs.setQueryResult(priceBaseResult);
        return l2rRs;
    }
}
